<template>
    <a-modal
      title="预算调配申请表打印"
      :visible="printFormVisible"
      :maskClosable="false"
      :closable="true"
      :destroyOnClose="true"
      :width="794+48+16"
      :dialog-style="{ margin: '0 auto' }"
      wrapClassName="form-modal-Lu"
      @cancel="closeVisible">
      <template slot="footer" style="text-align:center;">
        <a-button @click="closeVisible" type="primary">关闭</a-button>
      </template>
      <!-- <a-tabs type="card" v-if="printFormVisible">
        <a-tab-pane key="1" tab="审批表">
            <div class="print-div-shu" id="printTest">
              <h1 class="h1-page">款级经济科目调整审批表</h1>
              <p>
                <span style="float: right;font-size: 16px;">{{ form.fsqsj.substr(0,10) }}</span>
              </p>
              <table border="1" cellspacing="0" class="table-Lu lgsq-table">
                <tr>
                  <th colspan="4">调入</th>
                </tr>
                <tr>
                  <td>项目名称</td>
                  <td>政府预算支出经济分类科目</td>
                  <td>部门预算支出经济分类科目</td>
                  <td>金额（元）</td>
                </tr>
                <tr v-for="(item,index) in intoData" :key="index">
                    <td>{{ item.fysxmmc }}</td>
                    <td>{{ item.fzfjjflmc }}</td>
                    <td><span>{{ item.fbmjjflbm }}</span>{{ item.fbmjjflmc }}</td>
                    <td>{{ item.ftpje }}</td>
                </tr>
                <tr>
                  <th colspan="4">调出</th>
                </tr>
                <tr>
                  <td>项目名称</td>
                  <td>政府预算支出经济分类科目</td>
                  <td>部门预算支出经济分类科目</td>
                  <td>金额（元）</td>
                </tr>
                <tr v-for="(item,index) in outData" :key="index">
                    <td>{{ item.fysxmmc }}</td>
                    <td>{{ item.fzfjjflmc }}</td>
                    <td><span>{{ item.fbmjjflbm }}</span>{{ item.fbmjjflmc }}</td>
                    <td>{{ item.ftpje }}</td>
                </tr>
                <tr>
                    <th>调整原因</th>
                    <td colspan="3">{{  form.fsqly }}</td>
                </tr>
                <tr>
                    <th>调整依据</th>
                    <td colspan="3">{{ form.ftzyj }}</td>
                </tr>
              </table>
              <p style="font-size: 16px;">
                    <span>申请人： {{ form.fsqr }}</span>
                    <span style="float: right;">审批人： {{ form.fksspyjr }}</span>
                </p>
          </div>
        </a-tab-pane>
        <a-button
          id="printBtn"
          slot="tabBarExtraContent"
          type="primary"
          v-print="printObj"
          class="blue-btn"
          style="margin-right: 80px;">
          打印
        </a-button>
      </a-tabs> -->
        <div>
            <a-button class="blue-btn" type="primary" v-print="printObj">打印</a-button>
        </div>
        <div v-if="printFormVisible" class="print-div-shu" id="printTest">
              <h1 class="h1-page" style="text-align: center;">款级经济科目调整审批表</h1>
              <p>
                <span style="float: right;font-size: 16px;">{{ form.fsqsj.substr(0,10) }}</span>
              </p>
              <table border="1" cellspacing="0" class="table-Lu lgsq-table">
                <tr>
                  <td colspan="4">调入</td>
                </tr>
                <tr>
                  <td>项目名称</td>
                  <td>政府预算支出经济分类科目</td>
                  <td>部门预算支出经济分类科目</td>
                  <td>金额（元）</td>
                </tr>
                <tr v-for="(item,index) in intoData" :key="index + 'into'">
                    <td style="line-height: 2;">{{ item.fysxmmc }}</td>
                    <td>{{ item.fzfjjflmc }}</td>
                    <td><span>{{ item.fbmjjflbm }}</span>{{ item.fbmjjflmc }}</td>
                    <td>{{ item.ftpje }}</td>
                </tr>
                <tr>
                  <td colspan="4">调出</td>
                </tr>
                <tr>
                  <td>项目名称</td>
                  <td>政府预算支出经济分类科目</td>
                  <td>部门预算支出经济分类科目</td>
                  <td>金额（元）</td>
                </tr>
                <tr v-for="(item,index) in outData" :key="index + 'out'">
                    <td style="line-height: 2;">{{ item.fysxmmc }}</td>
                    <td>{{ item.fzfjjflmc }}</td>
                    <td><span>{{ item.fbmjjflbm }}</span>{{ item.fbmjjflmc }}</td>
                    <td>{{ item.ftpje }}</td>
                </tr>
                <tr>
                    <td>调整原因</td>
                    <td colspan="3">{{  form.fsqly }}</td>
                </tr>
                <tr>
                    <td>调整依据</td>
                    <td colspan="3">{{ form.ftzyj }}</td>
                </tr>
              </table>
              <p style="font-size: 16px;">
                    <span>申请人： {{ form.fsqr }}</span>
                    <span style="float: right;">审批人： {{ form.fksspyjr }}</span>
                </p>
        </div>
    </a-modal>
  </template>
  <script>
  export default {
    data() {
      return {
        printFormVisible: false,
        printObj:{
          id:"printTest", //需要打印的id名称
          popTitle:"干部职工离岗请示（请假）登记表",//文档的名称
          // preview:true,//预览功能，不好用
          zIndex:'20002',
          beforeOpenCallback(vue){},
          openCallback (vue) {//打开之前
          },
          closeCallback (vue) {//关闭了打印工具
          },
        },
        form: {},
        intoData: [],
        outData: [],
        qmImgList: []
      }
    },
    methods: {
        getDate(val,item,item1,qmList){
            //console.log('printBtn')
            //console.log(val,item,item1)
            this.form = val
            this.intoData = item
            this.outData = item1
            this.qmImgList = qmList
        },
      closeVisible(){
        this.printFormVisible = false
      },
      getUrl(ids){
        let url = ''
        this.qmImgList.forEach(item => {
          if(item.hjmc == ids){
            url = item.url
          }
        })
        return url
      },
    },
  }
  </script>
  <style>
  /* @import url('../../../../administrativeOffice-new/css/oaLess.less');
  @import url('../../../../administrativeOffice-new/css/oaClass.css'); */
  </style>
